Revert "fix(ext/node): support numeric FDs in child_process stdio array (#32959)"#33017
Merged
bartlomieju merged 1 commit intomainfrom Mar 27, 2026
Merged
Revert "fix(ext/node): support numeric FDs in child_process stdio array (#32959)"#33017bartlomieju merged 1 commit intomainfrom
bartlomieju merged 1 commit intomainfrom
Conversation
crowlKats
approved these changes
Mar 26, 2026
5 tasks
bartlomieju
added a commit
that referenced
this pull request
Apr 2, 2026
Now that `fs.openSync` returns real OS file descriptors (#33039), numeric values in child_process stdio arrays should be treated as raw fds rather than Deno resource IDs. This re-lands the functionality from #32959 (reverted in #33017) with the correct fd-based approach. - Rename `StdioOrRid` to `StdioOrFd`, replace `Rid(ResourceId)` with `Fd(i32)` - `as_stdio()` dups the fd directly (Unix: `libc::dup`, Windows: handle clone) instead of looking up the resource table - `extra_stdio` now accepts `StdioOrFd` so numeric fds work beyond stdin/stdout/stderr - Hardcoded `Rid(1)`/`Rid(2)` for inherit become `Fd(1)`/`Fd(2)` Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bartlomieju
added a commit
that referenced
this pull request
Apr 3, 2026
## Summary Now that `fs.openSync` returns real OS file descriptors (#33039), numeric values in child_process stdio arrays should be treated as raw fds rather than Deno resource IDs. This re-lands the functionality from #32959 (reverted in #33017) with the correct fd-based approach. - Rename `StdioOrRid` to `StdioOrFd`, replace `Rid(ResourceId)` with `Fd(i32)` - `as_stdio()` dups the fd directly (`libc::dup` on Unix, handle clone on Windows) instead of looking up the resource table - `extra_stdio` now accepts `StdioOrFd` so numeric fds work beyond stdin/stdout/stderr - Hardcoded `Rid(1)`/`Rid(2)` for inherit become `Fd(1)`/`Fd(2)` - Remove unused `FileResource` import --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
bartlomieju
added a commit
that referenced
this pull request
Apr 3, 2026
## Summary Now that `fs.openSync` returns real OS file descriptors (#33039), numeric values in child_process stdio arrays should be treated as raw fds rather than Deno resource IDs. This re-lands the functionality from #32959 (reverted in #33017) with the correct fd-based approach. - Rename `StdioOrRid` to `StdioOrFd`, replace `Rid(ResourceId)` with `Fd(i32)` - `as_stdio()` dups the fd directly (`libc::dup` on Unix, handle clone on Windows) instead of looking up the resource table - `extra_stdio` now accepts `StdioOrFd` so numeric fds work beyond stdin/stdout/stderr - Hardcoded `Rid(1)`/`Rid(2)` for inherit become `Fd(1)`/`Fd(2)` - Remove unused `FileResource` import --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reverts #32959 (commit ffbe236) which added support for numeric FDs in
child_processstdio array.The reverted commit changed deserialization of numeric values in stdio config from
Rid(ResourceId)toFd(i32), meaning all numeric stdio values are now interpreted as raw OS file descriptors instead of Deno resource IDs. This is a breaking change because Deno's Node-compatfs.openSynccurrently returns Deno resource IDs, not raw file descriptors (unlike Node.js which returns raw FDs).Any code that passes a numeric value from
fs.openSync(or similar) as a stdio option now callsdup()on a wrong/nonexistent OS file descriptor instead of looking it up in Deno's resource table. This was reported as breaking Claude Code installed via Deno -- it could not run Bash at all.#31965 needs to land first (making
fs.openSyncreturn raw FDs), and then #32959 can be re-landed safely.